import { Cache } from "../../../cache/Cache";
import { EquipmentUtil } from "../../common/util/EquipmentUtil";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { TextUtil } from "../../../../common/text/TextUtil";
import { QiXingShenHunConfig } from "../../../resource/QiXingShenHunConfig";
import { PetUtil } from "../../pet/info/PetUtil";
import { ItemConfig } from "../../../resource/ItemConfig";
import { ECategory } from "../../../../../Message/Public/ECategory";
import { EProp } from "../../../../../Message/Public/EProp";
type int = number;
//class GodSoulUtil
    
    export  class GodSoulUtil
    {
        

        public static getAttribute(arg1: Map<any, any> /* flash.utils.Dictionary */): string
        {
            var loc4=null;
            var loc1="";
            var loc2=Cache.instance.role.entityInfo.career;
            var loc3;
            var loc5=(loc3 = EquipmentUtil.getSelfCareerAttribute(loc2, arg1)).length;
            var loc6=0;
            while (loc6 < loc5) 
            {
                loc4 = loc3[loc6];
                if (loc6 % 2 != 0) 
                {
                    loc1 = loc1 + (loc4.name + "：" + HTMLUtil.addColor(loc4.value.toString(), GlobalStyle.color2) + "<br>");
                }
                else 
                {
                    loc1 = loc1 + (loc4.name + "：" + HTMLUtil.addColor(loc4.value.toString(), GlobalStyle.color2) + TextUtil.fillChar(loc4.name + "：" + loc4.value, 15));
                }
                ++loc6;
            }
            return loc1;
        }

        public static get totalAttribute(): string
        {
            var loc1=[];
            var loc2=Cache.instance.godSoul;
            var loc3=1;
            while (loc3 <= 7) 
            {
                if (!(loc2.levelInfo[loc3] <= 0)) 
                {
                    loc1.push(QiXingShenHunConfig.instance.getAttribute(loc3, loc2.levelInfo[loc3]));
                }
                ++loc3;
            }
            return GodSoulUtil.getAttribute(PetUtil.getAttr(loc1));
        }

        public static get propExp(): int
        {
            return ItemConfig.instance.getItemByType(ECategory._ECategoryProp, EProp._EPropQixingShenhun).item.effect;
        }
    }
